import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { FormBuilder, Validators } from '@angular/forms';
import { NzMessageService, NzModalService } from 'ng-zorro-antd';
import { ApiService } from 'src/app/core/api';
import { MessageService } from 'src/app/core/service/message.service';
 
/**
 * 首页
 */

@Component({
    templateUrl: './home.html',
    styleUrls: ['./home.scss'],
})
export class HomeComponent implements OnInit {
    pages={
        pageNo:1,
        pageSize:10,
        total:0,
        keyLevel:'',
        cityId:'3206',
        areaId:'',
        status:'',
        name:'',
    };
    selectRow:any = {};
    dataList = [];
    areaList= [];
    tableLoading = false;
    ngOnInit() {
        this.apiService.post('获取各个区',{"provinceId":"","cityId":"3206","areaId":""}).then((res:any)=>{
            this.areaList = res.data;
        });
        this.loadList();
    }
    constructor(
        private router: Router,
        private fb: FormBuilder,
        private apiService: ApiService,
        private message: MessageService,
        private nzMessageService: NzMessageService,
        private modal: NzModalService
    ) { }
    selectThis(data){
        this.selectRow = data;
    }
    loadList(){
        this.apiService.post('企业列表',this.pages).then((res:any)=>{
            this.dataList = res.data.list;
        })
    }
}
